# vim: ai ts=4 sts=4 et sw=4

from django.conf.urls.defaults import *
from tvapi.thetvdb.views import *
from tvapi.api.thetvdb.views import *
#from tvapi.api.views import *
import tvapi

# Uncomment the next two lines to enable the admin:
from django.contrib import admin
admin.autodiscover()

urlpatterns = patterns('',
    # Example:
    # (r'^thetvdbapi/', include('thetvdbapi.foo.urls')),

    # Uncomment the admin/doc line below and add 'django.contrib.admindocs' 
    # to INSTALLED_APPS to enable admin documentation:
    # (r'^admin/doc/', include('django.contrib.admindocs.urls')),

    # Uncomment the next line to enable the admin:
    # (r'^admin/', include(admin.site.urls)),
    (r'^admin/', include(admin.site.urls)),
    (r'^media/(?P<path>.*)$', 'django.views.static.serve', {'document_root': settings.MEDIA_ROOT}),
    (r'^api/import/languages', tvapi.thetvdb.views.ImportLanguages),
    (r'^api/import/series/(?P<seriesid>[0-9]+)$', tvapi.thetvdb.views.ImportSeries),
    (r'^api/import/episode/(?P<seriesid>[0-9]+)/(?P<language>[a-z]+)/(?P<season>[0-9]+)/(?P<episode>[0-9]+)', tvapi.thetvdb.views.ImportEpisode),
    (r'^api/', include('tvapi.api.urls')),
#    (r'^api/thetvdb/languages.json', tvapi.api.views.LanguagesHandler),
#    (r'^api/thetvdb/GetSeries$', tvapi.api.views.SeriesSearchHandler),
#    (r'^api/thetvdb/series/(?P<seriesid>[0-9]+)/actors$', tvapi.api.views.ActorRolesSeriesHandler),
#    (r'^api/thetvdb/actor/(?P<actorid>[0-9]+)$', tvapi.api.views.ActorHandler),

    #(r'^api/getimage', tvapi.thetvdb.views.get_image),
#    (r'^api/image/(?P<obj_id>[0-9]+)/(?P<type>[a-z]+)/(?P<img_id>[0-9\-]+)\.jpg', tvapi.thetvdb.views.get_image),
#    (r'^api/image/(?P<obj_id>[0-9]+)/(?P<type>[a-z]+)/(?P<series_id>[0-9]+)/(?P<img_id>[0-9\-]+)\.jpg', tvapi.thetvdb.views.get_episode_image),
    
        # JSON 
#    (r'^json/series/search/(?P<title>[0-9a-zA-Z]+)', tvapi.api.thetvdb.views.SeriesSearch),
#    (r'^json/series/details/(?P<id>[0-9]+)', tvapi.api.thetvdb.views.SeriesDetails),
#    (r'^json/episode/list/(?P<id>[0-9]+)', tvapi.api.thetvdb.views.EpisodeList),
#    (r'^json/episode/detail/(?P<id>[0-9]+)', tvapi.api.thetvdb.views.EpisodeDetail),
#    (r'^json/season/list/(?P<id>[0-9]+)', tvapi.api.thetvdb.views.SeasonList),
#    (r'^json/actor/detail/(?P<actor_id>[0-9]+)/(?P<series_id>[0-9]+)', tvapi.api.thetvdb.views.ActorDetail),
#    (r'^json/languages', tvapi.api.thetvdb.views.ListLanguages),

#    (r'^tvlistings/import', tvapi.tvlistings.views.importXML),
#    (r'^tvlistings/export', tvapi.tvlistings.views.export),


)
